////////////////////////////////////////////////////////////////////////////////////////
// Stauffer Public Perceptions of Women's Inclusion and Feelings of Political Efficacy
// Replication Code - Appendix 3
///////////////////////////////////////////////////////////////////////////////////////

***********
// TABLE A2
***********

*set working directory
use 1618_CCES.dta, clear

///2016
*Women 
xtmixed efficacy_1 c.r_estimate i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==1 & year==2016 || state:, cov(uns)
estimates store w16

xtmixed efficacy_1 c.r_estimate##i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==1 & year==2016 || state:, cov(uns)
estimates store w16_2

*Men
xtmixed efficacy_1 c.r_estimate i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==0 & year==2016 || state:, cov(uns)
estimates store m16

xtmixed efficacy_1 c.r_estimate##i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==0 & year==2016 || state:, cov(uns)
estimates store m16_2


///2018 
*Women 
xtmixed efficacy_1 c.r_estimate i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==1 & year==2018 || state:, cov(uns)
estimates store w18

xtmixed efficacy_1 c.r_estimate##i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==1 & year==2018 || state:, cov(uns)
estimates store w18_2

*Men
xtmixed efficacy_1 c.r_estimate i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==0 & year==2018 || state:, cov(uns)
estimates store m18

xtmixed efficacy_1 c.r_estimate##i.party c.ideo7 strong_partisan know_fed religiosity ///
coll white c.age##c.age employed i.woman_sen i.woman_rep c.stateleg i.year if gender_r==0 & year==2018 || state:, cov(uns)
estimates store m18_2


*Generate Latex Code For Table
estout w16 w16_2 w18 w18_2 m16 m16_2 m18 m18_2, cells(b(star fmt(%9.3f)) se(par)) ///
style(tex) stats(N) nobaselevels interaction ("X") starlevels (* .1 ** .05 *** .01)
